package com.qf.leadnewsjob.jobs;

import com.qf.leadnewsjob.feign.ArticleFeignApi;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
@Slf4j
public class XxlJobs {

    @Autowired
    private ArticleFeignApi articleFeignApi;

    /**
     * 计算热点文章的任务
     */
    @XxlJob("computeHotArticle")
    public void computeHotArticle(){
        log.info("----计算热点文章----" + LocalDateTime.now());
        articleFeignApi.computeHot();
    }

}
